package com.example.hackotontest;

import com.example.hackotontest.client.ClientActivity;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class UserActivity extends Activity implements OnClickListener {

	public static Typeface tf;
	private String username;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user);
                
        tf = Typeface.createFromAsset(getAssets(),"data/fonts/font.ttf");
        
        TextView tv = (TextView) findViewById(R.id.scrum);
        TextView tv1 = (TextView) findViewById(R.id.team);
        TextView tv2 = (TextView) findViewById(R.id.exit);
        
        tv.setTypeface(tf);
        tv1.setTypeface(tf);
        tv2.setTypeface(tf);
        
        tv.setOnClickListener(this);
        tv1.setOnClickListener(this);
        tv2.setOnClickListener(this);   
        
      //get the username
      Intent intent = getIntent();
      username = intent.getStringExtra("username");  		   
    }
      
	public void onClick(View v) {
		
		switch(v.getId()){
			case R.id.scrum:
				Intent iScrum = new Intent(this, USListActivity.class);
				iScrum.putExtra("username", username);
				startActivity(iScrum);
				break;
			case R.id.team:
				Intent iTeam = new Intent(this, ClientActivity.class);
				iTeam.putExtra("username", username);
				startActivity(iTeam);
				break;
			case R.id.exit:
				finish();
				moveTaskToBack(true);
				System.exit(0);
				break;
		}
		
	}
}

